//
//  ActivityDetailDescCell.m
//  ExcellentHome
//
//  Created by 揭婧雯 on 16/9/2.
//  Copyright © 2016年 陈区. All rights reserved.
//

#import "ActivityDetailDescCell.h"

@interface ActivityDetailDescCell ()

@property (nonatomic, strong) UILabel* descLabel;
@property (nonatomic, strong) UILabel* contentLabel;

@end


@implementation ActivityDetailDescCell

+ (instancetype)cellWithTableView:(UITableView*)tableView
{
    ActivityDetailDescCell* cell = [tableView dequeueReusableCellWithIdentifier:kActivityDetailDescCellIdentifier];
    
    if (cell == nil) {
        
        cell = [[ActivityDetailDescCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:kActivityDetailDescCellIdentifier];
    }
    
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    
    return cell;
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString*)reuseIdentifier
{
    
    if (self == [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        [self setupUI];
    }
    return self;
}

- (void)setFrame:(CGRect)frame
{
    frame.size.width = [UIScreen mainScreen].bounds.size.width;
    [super setFrame:frame];
}

- (void)setupUI
{
    self.accessoryType = UITableViewCellAccessoryNone;
    self.selectionStyle = UITableViewCellSelectionStyleNone;

    CGRect cellBounds = CGRectMake(10, 43, CGRectGetWidth(self.bounds), 0.5);
    UIImageView *linebg = [[UIImageView alloc] initWithFrame:cellBounds];
    linebg.image = [UIImage imageWithContentsOfFile:SEGPicName(@"common_line610px.png")];
    [self.contentView addSubview:linebg];
    
    self.descLabel = [[UILabel alloc] initWithFrame:CGRectMake(20, 0, 200, 44)];
    self.descLabel.font = [UIFont systemFontOfSize:FONT_LIST_AND_DETAIL_SIZE];
    self.descLabel.textColor=kColor_2;
    self.descLabel.backgroundColor = [UIColor clearColor];
    self.descLabel.text=@"参与人数";
    [self.contentView addSubview:self.descLabel];
    
    self.contentLabel = [[UILabel alloc] initWithFrame:CGRectMake(100, 0, 200, 44)];
    self.contentLabel.font = [UIFont systemFontOfSize:FONT_LIST_AND_DETAIL_SIZE];
    self.contentLabel.backgroundColor = [UIColor clearColor];
    self.contentLabel.tag = 1021;
    self.contentLabel.textColor=kColor_1;
    [self.contentView addSubview:self.contentLabel];

}

- (void)setDesc:(NSString *)desc
{
    self.descLabel.text = desc;
}
- (void)setContent:(NSString *)content
{
    self.contentLabel.text = content;
}

@end
